package com.himore.api.web.service.impl;

import java.util.List;

import com.himore.api.common.core.text.Convert;
import com.himore.api.common.utils.DateUtils;
import com.himore.api.web.mapper.TCommentPictureMapper;
import com.himore.api.web.model.TCommentPicture;
import com.himore.api.web.service.ITCommentPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * 评论图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-12
 */
@Service
public class TCommentPictureServiceImpl implements ITCommentPictureService
{
    @Autowired
    private TCommentPictureMapper tCommentPictureMapper;

    /**
     * 查询评论图片
     * 
     * @param picId 评论图片ID
     * @return 评论图片
     */
    @Override
    public TCommentPicture selectTCommentPictureById(Long picId)
    {
        return tCommentPictureMapper.selectTCommentPictureById(picId);
    }

    /**
     * 查询评论图片列表
     * 
     * @param tCommentPicture 评论图片
     * @return 评论图片
     */
    @Override
    public List<TCommentPicture> selectTCommentPictureList(TCommentPicture tCommentPicture)
    {
        return tCommentPictureMapper.selectTCommentPictureList(tCommentPicture);
    }

    /**
     * 新增评论图片
     * 
     * @param tCommentPicture 评论图片
     * @return 结果
     */
    @Override
    public int insertTCommentPicture(TCommentPicture tCommentPicture)
    {
        tCommentPicture.setCreateTime(DateUtils.getNowDate());
        return tCommentPictureMapper.insertTCommentPicture(tCommentPicture);
    }

    /**
     * 修改评论图片
     * 
     * @param tCommentPicture 评论图片
     * @return 结果
     */
    @Override
    public int updateTCommentPicture(TCommentPicture tCommentPicture)
    {
        tCommentPicture.setUpdateTime(DateUtils.getNowDate());
        return tCommentPictureMapper.updateTCommentPicture(tCommentPicture);
    }

    /**
     * 删除评论图片对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTCommentPictureByIds(String ids)
    {
        return tCommentPictureMapper.deleteTCommentPictureByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除评论图片信息
     * 
     * @param picId 评论图片ID
     * @return 结果
     */
    @Override
    public int deleteTCommentPictureById(Long picId)
    {
        return tCommentPictureMapper.deleteTCommentPictureById(picId);
    }
}
